home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / bin_c / compile_to_c22.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-02  |  12.7 KB  |  567 lines

  1. /* ANSI C code generated by SmallEiffel. */
  2. /*
  3. -- SmallEiffel  -- Release (- 0.97)    --      FRANCE
  4. -- Copyright (C), 1994 - Dominique COLNET and Suzanne COLLIN 
  5. -- University Henri Poincare' - Nancy 1 - email colnet@loria.fr 
  6. -- CRIN (Centre de Recherche en Informatique de Nancy)
  7. -- FRANCE 
  8. */
  9. #include "compile_to_c.h"
  10. void rT130copy(T130 *C,T0* a1){
  11. int _i=0;
  12. C->_upper=((C)->_lower)-(1);
  13. /*IF*/if (((C)->_capacity)==(0)) {
  14. rT130make(C,((T130*)a1)->_lower,((T130*)a1)->_upper);
  15. }
  16. else {
  17. rT130resize(C,((T130*)a1)->_lower,((T130*)a1)->_upper);
  18. }
  19. /*FI*/_i=(C)->_lower;
  20. while (!((_i)>((C)->_upper))) {
  21. rT130put(C,rT130item((T130*)a1,_i),_i);
  22. _i=(_i)+(1);
  23. }
  24. }
  25. void rT130make(T130 *C,int a1,int a2){
  26. /*IF*/{/*AT*/free(C->_storage);
  27. }
  28. /*FI*/C->_lower=a1;
  29. C->_upper=a2;
  30. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  31. C->_storage=NULL;
  32. /*IF*/if (((C)->_capacity)>(0)) {
  33. C->_capacity=((C)->_capacity)+(16);
  34. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  35. rT130clear_all(C);
  36. }
  37. /*FI*/}
  38. void rT134clear_all(T134 *C){
  39. T0 * _value=NULL;
  40. rT134set_all_with(C,_value);
  41. }
  42. int rT134count(T134 *C){
  43. int R=0;
  44. R=(((C)->_upper)-((C)->_lower))+(1);
  45. return R;
  46. }
  47. void rT134set_all_with(T134 *C,T0 * a1){
  48. int _i=0;
  49. _i=(C)->_upper;
  50. while (!((_i)<((C)->_lower))) {
  51. rT134put(C,a1,_i);
  52. _i=(_i)-(1);
  53. }
  54. }
  55. void rT134resize(T134 *C,int a1,int a2){
  56. int _up=0;
  57. int _i=0;
  58. T0* _other=NULL;
  59. {T134 *n=((T134*)new(134));
  60. rT134make(n,a1,a2);
  61. _other=(T0 *)n;}
  62. _i=rT2max((C)->_lower,((T134*)_other)->_lower);
  63. _up=rT2min((C)->_upper,((T134*)_other)->_upper);
  64. while (!((_i)>(_up))) {
  65. rT134put((T134*)_other,rT134item(C,_i),_i);
  66. _i=(_i)+(1);
  67. }
  68. /*IF*/{/*AT*/free(C->_storage);
  69. }
  70. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  71. }
  72. T0 * rT134item(T134 *C,int a1){
  73. T0 * R=NULL;
  74. R=(C->_storage)[a1-(C->_lower)];
  75. return R;
  76. }
  77. void rT134add_last(T134 *C,T0 * a1){
  78. /*IF*/if (((C)->_capacity)<((rT134count(C))+(1))) {
  79. C->_capacity=((C)->_capacity)+(16);
  80. /*IF*/if (((C)->_capacity)==(16)) {
  81. C->_storage=malloc(16*sizeof(*(C->_storage)));
  82. }
  83. else {
  84. C->_storage=realloc(C->_storage,((C->_capacity)*sizeof(*(C->_storage))));
  85. }
  86. /*FI*/}
  87. /*FI*/C->_upper=((C)->_upper)+(1);
  88. rT134put(C,a1,(C)->_upper);
  89. }
  90. void rT134put(T134 *C,T0 * a1,int a2){
  91. (C->_storage)[a2-(C->_lower)]=a1;
  92. }
  93. void rT134copy(T134 *C,T0* a1){
  94. int _i=0;
  95. C->_upper=((C)->_lower)-(1);
  96. /*IF*/if (((C)->_capacity)==(0)) {
  97. rT134make(C,((T134*)a1)->_lower,((T134*)a1)->_upper);
  98. }
  99. else {
  100. rT134resize(C,((T134*)a1)->_lower,((T134*)a1)->_upper);
  101. }
  102. /*FI*/_i=(C)->_lower;
  103. while (!((_i)>((C)->_upper))) {
  104. rT134put(C,rT134item((T134*)a1,_i),_i);
  105. _i=(_i)+(1);
  106. }
  107. }
  108. void rT134make(T134 *C,int a1,int a2){
  109. /*IF*/{/*AT*/free(C->_storage);
  110. }
  111. /*FI*/C->_lower=a1;
  112. C->_upper=a2;
  113. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  114. C->_storage=NULL;
  115. /*IF*/if (((C)->_capacity)>(0)) {
  116. C->_capacity=((C)->_capacity)+(16);
  117. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  118. rT134clear_all(C);
  119. }
  120. /*FI*/}
  121. void rT141clear_all(T141 *C){
  122. T0 * _value=NULL;
  123. rT141set_all_with(C,_value);
  124. }
  125. int rT141count(T141 *C){
  126. int R=0;
  127. R=(((C)->_upper)-((C)->_lower))+(1);
  128. return R;
  129. }
  130. void rT141set_all_with(T141 *C,T0 * a1){
  131. int _i=0;
  132. _i=(C)->_upper;
  133. while (!((_i)<((C)->_lower))) {
  134. rT141put(C,a1,_i);
  135. _i=(_i)-(1);
  136. }
  137. }
  138. void rT141resize(T141 *C,int a1,int a2){
  139. int _up=0;
  140. int _i=0;
  141. T0* _other=NULL;
  142. {T141 *n=((T141*)new(141));
  143. rT141make(n,a1,a2);
  144. _other=(T0 *)n;}
  145. _i=rT2max((C)->_lower,((T141*)_other)->_lower);
  146. _up=rT2min((C)->_upper,((T141*)_other)->_upper);
  147. while (!((_i)>(_up))) {
  148. rT141put((T141*)_other,rT141item(C,_i),_i);
  149. _i=(_i)+(1);
  150. }
  151. /*IF*/{/*AT*/free(C->_storage);
  152. }
  153. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  154. }
  155. T0 * rT141item(T141 *C,int a1){
  156. T0 * R=NULL;
  157. R=(C->_storage)[a1-(C->_lower)];
  158. return R;
  159. }
  160. void rT141add_last(T141 *C,T0 * a1){
  161. /*IF*/if (((C)->_capacity)<((rT141count(C))+(1))) {
  162. C->_capacity=((C)->_capacity)+(16);
  163. /*IF*/if (((C)->_capacity)==(16)) {
  164. C->_storage=malloc(16*sizeof(*(C->_storage)));
  165. }
  166. else {
  167. C->_storage=realloc(C->_storage,((C->_capacity)*sizeof(*(C->_storage))));
  168. }
  169. /*FI*/}
  170. /*FI*/C->_upper=((C)->_upper)+(1);
  171. rT141put(C,a1,(C)->_upper);
  172. }
  173. void rT141put(T141 *C,T0 * a1,int a2){
  174. (C->_storage)[a2-(C->_lower)]=a1;
  175. }
  176. void rT141copy(T141 *C,T0* a1){
  177. int _i=0;
  178. C->_upper=((C)->_lower)-(1);
  179. /*IF*/if (((C)->_capacity)==(0)) {
  180. rT141make(C,((T141*)a1)->_lower,((T141*)a1)->_upper);
  181. }
  182. else {
  183. rT141resize(C,((T141*)a1)->_lower,((T141*)a1)->_upper);
  184. }
  185. /*FI*/_i=(C)->_lower;
  186. while (!((_i)>((C)->_upper))) {
  187. rT141put(C,rT141item((T141*)a1,_i),_i);
  188. _i=(_i)+(1);
  189. }
  190. }
  191. void rT141make(T141 *C,int a1,int a2){
  192. /*IF*/{/*AT*/free(C->_storage);
  193. }
  194. /*FI*/C->_lower=a1;
  195. C->_upper=a2;
  196. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  197. C->_storage=NULL;
  198. /*IF*/if (((C)->_capacity)>(0)) {
  199. C->_capacity=((C)->_capacity)+(16);
  200. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  201. rT141clear_all(C);
  202. }
  203. /*FI*/}
  204. void rT143clear_all(T143 *C){
  205. T0 * _value=NULL;
  206. rT143set_all_with(C,_value);
  207. }
  208. int rT143count(T143 *C){
  209. int R=0;
  210. R=(((C)->_upper)-((C)->_lower))+(1);
  211. return R;
  212. }
  213. void rT143set_all_with(T143 *C,T0 * a1){
  214. int _i=0;
  215. _i=(C)->_upper;
  216. while (!((_i)<((C)->_lower))) {
  217. rT143put(C,a1,_i);
  218. _i=(_i)-(1);
  219. }
  220. }
  221. void rT143resize(T143 *C,int a1,int a2){
  222. int _up=0;
  223. int _i=0;
  224. T0* _other=NULL;
  225. {T143 *n=((T143*)new(143));
  226. rT143make(n,a1,a2);
  227. _other=(T0 *)n;}
  228. _i=rT2max((C)->_lower,XrT143lower(_other));
  229. _up=rT2min((C)->_upper,XrT143upper(_other));
  230. while (!((_i)>(_up))) {
  231. XrT143put(_other,rT143item(C,_i),_i);
  232. _i=(_i)+(1);
  233. }
  234. /*IF*/{/*AT*/free(C->_storage);
  235. }
  236. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  237. }
  238. T0 * rT143item(T143 *C,int a1){
  239. T0 * R=NULL;
  240. R=(C->_storage)[a1-(C->_lower)];
  241. return R;
  242. }
  243. void rT143add_last(T143 *C,T0 * a1){
  244. /*IF*/if (((C)->_capacity)<((rT143count(C))+(1))) {
  245. C->_capacity=((C)->_capacity)+(16);
  246. /*IF*/if (((C)->_capacity)==(16)) {
  247. C->_storage=malloc(16*sizeof(*(C->_storage)));
  248. }
  249. else {
  250. C->_storage=realloc(C->_storage,((C->_capacity)*sizeof(*(C->_storage))));
  251. }
  252. /*FI*/}
  253. /*FI*/C->_upper=((C)->_upper)+(1);
  254. rT143put(C,a1,(C)->_upper);
  255. }
  256. void rT143put(T143 *C,T0 * a1,int a2){
  257. (C->_storage)[a2-(C->_lower)]=a1;
  258. }
  259. void rT143copy(T143 *C,T0* a1){
  260. int _i=0;
  261. C->_upper=((C)->_lower)-(1);
  262. /*IF*/if (((C)->_capacity)==(0)) {
  263. rT143make(C,XrT143lower(a1),XrT143upper(a1));
  264. }
  265. else {
  266. rT143resize(C,XrT143lower(a1),XrT143upper(a1));
  267. }
  268. /*FI*/_i=(C)->_lower;
  269. while (!((_i)>((C)->_upper))) {
  270. rT143put(C,XrT143item(a1,_i),_i);
  271. _i=(_i)+(1);
  272. }
  273. }
  274. void rT143make(T143 *C,int a1,int a2){
  275. /*IF*/{/*AT*/free(C->_storage);
  276. }
  277. /*FI*/C->_lower=a1;
  278. C->_upper=a2;
  279. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  280. C->_storage=NULL;
  281. /*IF*/if (((C)->_capacity)>(0)) {
  282. C->_capacity=((C)->_capacity)+(16);
  283. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  284. rT143clear_all(C);
  285. }
  286. /*FI*/}
  287. void rT147clear_all(T147 *C){
  288. T0 * _value=NULL;
  289. rT147set_all_with(C,_value);
  290. }
  291. int rT147count(T147 *C){
  292. int R=0;
  293. R=(((C)->_upper)-((C)->_lower))+(1);
  294. return R;
  295. }
  296. void rT147set_all_with(T147 *C,T0 * a1){
  297. int _i=0;
  298. _i=(C)->_upper;
  299. while (!((_i)<((C)->_lower))) {
  300. rT147put(C,a1,_i);
  301. _i=(_i)-(1);
  302. }
  303. }
  304. void rT147resize(T147 *C,int a1,int a2){
  305. int _up=0;
  306. int _i=0;
  307. T0* _other=NULL;
  308. {T147 *n=((T147*)new(147));
  309. rT147make(n,a1,a2);
  310. _other=(T0 *)n;}
  311. _i=rT2max((C)->_lower,((T147*)_other)->_lower);
  312. _up=rT2min((C)->_upper,((T147*)_other)->_upper);
  313. while (!((_i)>(_up))) {
  314. rT147put((T147*)_other,rT147item(C,_i),_i);
  315. _i=(_i)+(1);
  316. }
  317. /*IF*/{/*AT*/free(C->_storage);
  318. }
  319. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  320. }
  321. T0 * rT147item(T147 *C,int a1){
  322. T0 * R=NULL;
  323. R=(C->_storage)[a1-(C->_lower)];
  324. return R;
  325. }
  326. void rT147add_last(T147 *C,T0 * a1){
  327. /*IF*/if (((C)->_capacity)<((rT147count(C))+(1))) {
  328. C->_capacity=((C)->_capacity)+(16);
  329. /*IF*/if (((C)->_capacity)==(16)) {
  330. C->_storage=malloc(16*sizeof(*(C->_storage)));
  331. }
  332. else {
  333. C->_storage=realloc(C->_storage,((C->_capacity)*sizeof(*(C->_storage))));
  334. }
  335. /*FI*/}
  336. /*FI*/C->_upper=((C)->_upper)+(1);
  337. rT147put(C,a1,(C)->_upper);
  338. }
  339. void rT147put(T147 *C,T0 * a1,int a2){
  340. (C->_storage)[a2-(C->_lower)]=a1;
  341. }
  342. void rT147copy(T147 *C,T0* a1){
  343. int _i=0;
  344. C->_upper=((C)->_lower)-(1);
  345. /*IF*/if (((C)->_capacity)==(0)) {
  346. rT147make(C,((T147*)a1)->_lower,((T147*)a1)->_upper);
  347. }
  348. else {
  349. rT147resize(C,((T147*)a1)->_lower,((T147*)a1)->_upper);
  350. }
  351. /*FI*/_i=(C)->_lower;
  352. while (!((_i)>((C)->_upper))) {
  353. rT147put(C,rT147item((T147*)a1,_i),_i);
  354. _i=(_i)+(1);
  355. }
  356. }
  357. void rT147make(T147 *C,int a1,int a2){
  358. /*IF*/{/*AT*/free(C->_storage);
  359. }
  360. /*FI*/C->_lower=a1;
  361. C->_upper=a2;
  362. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  363. C->_storage=NULL;
  364. /*IF*/if (((C)->_capacity)>(0)) {
  365. C->_capacity=((C)->_capacity)+(16);
  366. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  367. rT147clear_all(C);
  368. }
  369. /*FI*/}
  370. void rT151clear_all(T151 *C){
  371. T0 * _value=NULL;
  372. rT151set_all_with(C,_value);
  373. }
  374. int rT151count(T151 *C){
  375. int R=0;
  376. R=(((C)->_upper)-((C)->_lower))+(1);
  377. return R;
  378. }
  379. void rT151set_all_with(T151 *C,T0 * a1){
  380. int _i=0;
  381. _i=(C)->_upper;
  382. while (!((_i)<((C)->_lower))) {
  383. rT151put(C,a1,_i);
  384. _i=(_i)-(1);
  385. }
  386. }
  387. int rT151fast_index_of(T151 *C,T0 * a1){
  388. int R=0;
  389. R=(C)->_lower;
  390. while (!(((R)>((C)->_upper))||(((T0 *)a1)==((T0 *)rT151item(C,R))))) {
  391. R=(R)+(1);
  392. }
  393. return R;
  394. }
  395. void rT151resize(T151 *C,int a1,int a2){
  396. int _up=0;
  397. int _i=0;
  398. T0* _other=NULL;
  399. {T151 *n=((T151*)new(151));
  400. rT151make(n,a1,a2);
  401. _other=(T0 *)n;}
  402. _i=rT2max((C)->_lower,((T151*)_other)->_lower);
  403. _up=rT2min((C)->_upper,((T151*)_other)->_upper);
  404. while (!((_i)>(_up))) {
  405. rT151put((T151*)_other,rT151item(C,_i),_i);
  406. _i=(_i)+(1);
  407. }
  408. /*IF*/{/*AT*/free(C->_storage);
  409. }
  410. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  411. }
  412. T0 * rT151item(T151 *C,int a1){
  413. T0 * R=NULL;
  414. R=(C->_storage)[a1-(C->_lower)];
  415. return R;
  416. }
  417. void rT151add_last(T151 *C,T0 * a1){
  418. /*IF*/if (((C)->_capacity)<((rT151count(C))+(1))) {
  419. C->_capacity=((C)->_capacity)+(16);
  420. /*IF*/if (((C)->_capacity)==(16)) {
  421. C->_storage=malloc(16*sizeof(*(C->_storage)));
  422. }
  423. else {
  424. C->_storage=realloc(C->_storage,((C->_capacity)*sizeof(*(C->_storage))));
  425. }
  426. /*FI*/}
  427. /*FI*/C->_upper=((C)->_upper)+(1);
  428. rT151put(C,a1,(C)->_upper);
  429. }
  430. void rT151put(T151 *C,T0 * a1,int a2){
  431. (C->_storage)[a2-(C->_lower)]=a1;
  432. }
  433. void rT151copy(T151 *C,T0* a1){
  434. int _i=0;
  435. C->_upper=((C)->_lower)-(1);
  436. /*IF*/if (((C)->_capacity)==(0)) {
  437. rT151make(C,((T151*)a1)->_lower,((T151*)a1)->_upper);
  438. }
  439. else {
  440. rT151resize(C,((T151*)a1)->_lower,((T151*)a1)->_upper);
  441. }
  442. /*FI*/_i=(C)->_lower;
  443. while (!((_i)>((C)->_upper))) {
  444. rT151put(C,rT151item((T151*)a1,_i),_i);
  445. _i=(_i)+(1);
  446. }
  447. }
  448. void rT151make(T151 *C,int a1,int a2){
  449. /*IF*/{/*AT*/free(C->_storage);
  450. }
  451. /*FI*/C->_lower=a1;
  452. C->_upper=a2;
  453. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  454. C->_storage=NULL;
  455. /*IF*/if (((C)->_capacity)>(0)) {
  456. C->_capacity=((C)->_capacity)+(16);
  457. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  458. rT151clear_all(C);
  459. }
  460. /*FI*/}
  461. void rT158clear(T158 *C){
  462. C->_upper=((C)->_lower)-(1);
  463. }
  464. void rT158clear_all(T158 *C){
  465. T0 * _value=NULL;
  466. rT158set_all_with(C,_value);
  467. }
  468. int rT158count(T158 *C){
  469. int R=0;
  470. R=(((C)->_upper)-((C)->_lower))+(1);
  471. return R;
  472. }
  473. void rT158set_all_with(T158 *C,T0 * a1){
  474. int _i=0;
  475. _i=(C)->_upper;
  476. while (!((_i)<((C)->_lower))) {
  477. rT158put(C,a1,_i);
  478. _i=(_i)-(1);
  479. }
  480. }
  481. void rT158resize(T158 *C,int a1,int a2){
  482. int _up=0;
  483. int _i=0;
  484. T0* _other=NULL;
  485. {T158 *n=((T158*)new(158));
  486. rT158make(n,a1,a2);
  487. _other=(T0 *)n;}
  488. _i=rT2max((C)->_lower,((T158*)_other)->_lower);
  489. _up=rT2min((C)->_upper,((T158*)_other)->_upper);
  490. while (!((_i)>(_up))) {
  491. rT158put((T158*)_other,rT158item(C,_i),_i);
  492. _i=(_i)+(1);
  493. }
  494. /*IF*/{/*AT*/free(C->_storage);
  495. }
  496. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  497. }
  498. int rT158fast_index_of(T158 *C,T0 * a1){
  499. int R=0;
  500. R=(C)->_lower;
  501. while (!(((R)>((C)->_upper))||(((T0 *)a1)==((T0 *)rT158item(C,R))))) {
  502. R=(R)+(1);
  503. }
  504. return R;
  505. }
  506. int rT158fast_has(T158 *C,T0 * a1){
  507. int R=0;
  508. R=(rT158fast_index_of(C,a1))!=(((C)->_upper)+(1));
  509. return R;
  510. }
  511. int rT158empty(T158 *C){
  512. int R=0;
  513. R=(rT158count(C))==(0);
  514. return R;
  515. }
  516. T0 * rT158item(T158 *C,int a1){
  517. T0 * R=NULL;
  518. R=(C->_storage)[a1-(C->_lower)];
  519. return R;
  520. }
  521. void rT158add_last(T158 *C,T0 * a1){
  522. /*IF*/if (((C)->_capacity)<((rT158count(C))+(1))) {
  523. C->_capacity=((C)->_capacity)+(16);
  524. /*IF*/if (((C)->_capacity)==(16)) {
  525. C->_storage=malloc(16*sizeof(*(C->_storage)));
  526. }
  527. else {
  528. C->_storage=realloc(C->_storage,((C->_capacity)*sizeof(*(C->_storage))));
  529. }
  530. /*FI*/}
  531. /*FI*/C->_upper=((C)->_upper)+(1);
  532. rT158put(C,a1,(C)->_upper);
  533. }
  534. void rT158put(T158 *C,T0 * a1,int a2){
  535. (C->_storage)[a2-(C->_lower)]=a1;
  536. }
  537. void rT158copy(T158 *C,T0* a1){
  538. int _i=0;
  539. C->_upper=((C)->_lower)-(1);
  540. /*IF*/if (((C)->_capacity)==(0)) {
  541. rT158make(C,((T158*)a1)->_lower,((T158*)a1)->_upper);
  542. }
  543. else {
  544. rT158resize(C,((T158*)a1)->_lower,((T158*)a1)->_upper);
  545. }
  546. /*FI*/_i=(C)->_lower;
  547. while (!((_i)>((C)->_upper))) {
  548. rT158put(C,rT158item((T158*)a1,_i),_i);
  549. _i=(_i)+(1);
  550. }
  551. }
  552. void rT158make(T158 *C,int a1,int a2){
  553. /*IF*/{/*AT*/free(C->_storage);
  554. }
  555. /*FI*/C->_lower=a1;
  556. C->_upper=a2;
  557. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  558. C->_storage=NULL;
  559. /*IF*/if (((C)->_capacity)>(0)) {
  560. C->_capacity=((C)->_capacity)+(16);
  561. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  562. rT158clear_all(C);
  563. }
  564. /*FI*/}
  565. int argument_count;
  566. T0 **argument;
  567.